﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CoreEx.Samples.DomainModel;
using LinFu.IoC.Configuration;

namespace CoreEx.ServiceModel.Tests
{
    
    [ServiceContract()]
    public interface ISampleService 
    {
        [OperationContract()]
        Customer GetCustomer();

        [OperationContract]
        IList<Customer> GetCustomers();

        [OperationContract]
        string MethodWithNullableParameters(int? intValue, string stringValue);

        [OperationContract]
        void Save(object target);
    }

    


    //[Implements(typeof(ISampleService))]
    public class SampleService : ISampleService 
    {
        public Customer GetCustomer()
        {
            return new Customer() { CustomerID = "ALFKI" };
        }

        public IList<Customer> GetCustomers()
        {                        
            var customer1 = new Customer() { CustomerID = "ALFKI" };
            var customer2 = new Customer() { CustomerID = "ANTON" };
            return new List<Customer>(new[] { customer1, customer2 });
        }

        public string MethodWithNullableParameters(int? intValue, string stringValue)
        {
            return stringValue;
        }

        public void Save(object target)
        {
            throw new NotImplementedException();
        }

        
    }


  

}
